﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Interfaces.General_Interfaces;
using Interfaces.Inherited_Interfaces;
using Presenters.General_Presenters;

namespace Views.General_Views
{
    public partial class MainForm : Form, IMainView
    {
        private MainViewPresenter presenter = null;

        public MainForm()
        {
            InitializeComponent();
            presenter = new MainViewPresenter(this);
        }

        private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            presenter.ClientsViewDisplay(new ClientsView());
        }

        private void toolStripLabel5_Click(object sender, EventArgs e)
        {
            presenter.ExitApp();
        }

        void ICloseable.Close()
        {
            this.Close();
        }

        void IMainView.AddToPanel(UserControl view)
        {
            panel.Controls.Clear();
            panel.Controls.Add(view);
        }

        T IView.ReturnView<T>()
        {
            return (T)((object)this);
        }

        private void toolStripLabel3_Click(object sender, EventArgs e)
        {
            panel.Controls.Clear();
            panel.Controls.Add(new RoadsView());
        }
    }
}
